<template>
  <DynamicTable :config="userConfig" :tableData="users">
    <template #actions="slotProps">
      <el-button size="small" @click="editUser(slotProps.row)">编辑</el-button>
      <el-button size="small" type="danger" @click="deleteUser(slotProps.row)"
        >删除</el-button
      >
    </template>
  </DynamicTable>
</template>

<script setup>
import DynamicTable from "@/components/TableItem.vue";
import { userTableConfig as userConfig } from "@/config/tableConfig";

const users = [
  { username: "张三", email: "zhangsan@example.com", gender: "M" },
  { username: "李四", email: "lisi@example.com", gender: "F" },
];

const editUser = (row) => {
  console.log("编辑", row);
};
const deleteUser = (row) => {
  console.log("删除", row);
};
</script>
